package com.coment.message.core;

import lombok.AllArgsConstructor;
import lombok.Getter;

public record ActionResult<T>(int code, T value, String message) {
    public boolean isOk() {
        return code == 200;
    }
}

@Getter
@AllArgsConstructor
enum ActionResultCode {
    OK(200,Object.class),
    NOT_FOUND(404, Object.class),
    BAD_REQUEST(400, Object.class),
    INTERNAL_SERVER_ERROR(500, Object.class);

    private final int code;
    private final Class<?> valueType;
}
